package conf

import (
	"fmt"
	"github.com/spf13/viper"
	"rpc/types"
)

func AppInit() {
	var Add types.Config
	viper.SetConfigFile("./dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		fmt.Println("读取失败", err)
		return
	}
	err = viper.Unmarshal(&Add)
	if err != nil {
		fmt.Println("解析失败", err)
		return
	}
	fmt.Println("动态配置连接成功", Add)
}
